<template>
  <div>
       <!-- 顶部 -->
     <van-nav-bar title="地址" left-text="返回" left-arrow fixed>
      <template>
        <van-icon name="search" size="18" />
      </template>
    </van-nav-bar>
      <!-- 地址 -->
    <van-address-list
      v-model="chosenAddressId"
      :list="list"
      :disabled-list="disabledList"
      disabled-text="以下地址超出配送范围"
      default-tag-text="默认"
       @add="onAdd" to="/xiugaiDZ"
      @edit="onEdit"
      style="margin-top:50px"
    />
    
  </div>
</template>
<script>
import { Toast } from 'vant';

export default {
  data() {
    return {
      chosenAddressId: '1',
      list: [
        {
          id: '1',
          name: '张三',
          tel: '111111111111111',
          address: '河南省郑州市二七区文三路 138 号东方通信大厦 7 楼 501 室',
          isDefault: true,
        },
        {
          id: '2',
          name: '李四',
          tel: '22222222222',
          address: '河南省郑州市二七区拱墅区莫干山路 50 号',
        },
      ],
      disabledList: [
        {
          id: '3',
          name: '王五',
          tel: '33333333333',
          address: '河南省郑州市二七区江南大道 15 号',
        },
      ],
    };
  },
  methods: {
    onAdd() {
      Toast('新增地址');
    },
    onEdit(item, index) {
      Toast('编辑地址:' + index);
    },
  },
};
</script>